package com.etoak.common.web.util;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

public class ServletUtil {
    public static HttpServletRequest getRequest() {
        return getAtrributes().getRequest();
    }
    public static HttpServletResponse getResponse() {
        return getAtrributes().getResponse();
    }

    private static ServletRequestAttributes getAtrributes() {
        return (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
    }
}
